<?php

require_once ('Zend/Form.php');

class FormAlbums extends Zend_Form{
	public function init() {
		//form 初始值時加入四個欄位，詳細資料請參考 day5
		$this->setName ( 'albums' );
		
		$id = new Zend_Form_Element_Hidden ( 'id' );
		$id->addFilter ( 'Int' );
		
		$artist = new Zend_Form_Element_Text ( 'artist' );
		$artist->setLabel ( '歌手' )->setRequired ( true )->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )->addValidator ( 'NotEmpty' );
		
		$title = new Zend_Form_Element_Text ( 'title' );
		$title->setLabel ( '專輯' )->setRequired ( true )->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )->addValidator ( 'NotEmpty' );
		
		$submit = new Zend_Form_Element_Submit ( 'submit' );
		$submit->setAttrib ( 'id', 'submitbutton' );
		
		$this->addElements ( array ($id, $artist, $title, $submit ) );
	}
}
?>